<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Host Common (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Host Common (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Host Common (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Host-Config.html#Host-Config" rel="up" title="Host Config">
<link href="Filesystem.html#Filesystem" rel="next" title="Filesystem">
<link href="Host-Config.html#Host-Config" rel="prev" title="Host Config">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="Host-Common"></a>
<div class="header">
<p>
Next: <a href="Filesystem.html#Filesystem" accesskey="n" rel="next">Filesystem</a>, Up: <a href="Host-Config.html#Host-Config" accesskey="u" rel="up">Host Config</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Host-Common-1"></a>
<h3 class="section">19.1 Host Common</h3>
<a name="index-host-hooks"></a>
<a name="index-host-functions"></a>

<p>Some things are just not portable, even between similar operating systems,
and are too difficult for autoconf to detect.  They get implemented using
hook functions in the file specified by the <var>host_hook_obj</var>
variable in <samp>config.gcc</samp>.
</p>
<dl>
<dt><a name="index-HOST_005fHOOKS_005fEXTRA_005fSIGNALS"></a>Host Hook: <em>void</em> <strong>HOST_HOOKS_EXTRA_SIGNALS</strong> <em>(void)</em></dt>
<dd><p>This host hook is used to set up handling for extra signals.  The most
common thing to do in this hook is to detect stack overflow.
</p></dd></dl>

<dl>
<dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fGET_005fADDRESS"></a>Host Hook: <em>void *</em> <strong>HOST_HOOKS_GT_PCH_GET_ADDRESS</strong> <em>(size_t   <var>size</var>, int <var>fd</var>)</em></dt>
<dd><p>This host hook returns the address of some space that is likely to be
free in some subsequent invocation of the compiler.  We intend to load
the PCH data at this address such that the data need not be relocated.
The area should be able to hold <var>size</var> bytes.  If the host uses
<code>mmap</code>, <var>fd</var> is an open file descriptor that can be used for
probing.
</p></dd></dl>

<dl>
<dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fUSE_005fADDRESS"></a>Host Hook: <em>int</em> <strong>HOST_HOOKS_GT_PCH_USE_ADDRESS</strong> <em>(void * <var>address</var>,   size_t <var>size</var>, int <var>fd</var>, size_t <var>offset</var>)</em></dt>
<dd><p>This host hook is called when a PCH file is about to be loaded.
We want to load <var>size</var> bytes from <var>fd</var> at <var>offset</var>
into memory at <var>address</var>.  The given address will be the result of
a previous invocation of <code>HOST_HOOKS_GT_PCH_GET_ADDRESS</code>.
Return -1 if we couldn&rsquo;t allocate <var>size</var> bytes at <var>address</var>.
Return 0 if the memory is allocated but the data is not loaded.  Return 1
if the hook has performed everything.
</p>
<p>If the implementation uses reserved address space, free any reserved
space beyond <var>size</var>, regardless of the return value.  If no PCH will
be loaded, this hook may be called with <var>size</var> zero, in which case
all reserved address space should be freed.
</p>
<p>Do not try to handle values of <var>address</var> that could not have been
returned by this executable; just return -1.  Such values usually
indicate an out-of-date PCH file (built by some other GCC executable),
and such a PCH file won&rsquo;t work.
</p></dd></dl>

<dl>
<dt><a name="index-HOST_005fHOOKS_005fGT_005fPCH_005fALLOC_005fGRANULARITY"></a>Host Hook: <em>size_t</em> <strong>HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY</strong> <em>(void);</em></dt>
<dd><p>This host hook returns the alignment required for allocating virtual
memory.  Usually this is the same as getpagesize, but on some hosts the
alignment for reserving memory differs from the pagesize for committing
memory.
</p></dd></dl>

<hr>
<div class="header">
<p>
Next: <a href="Filesystem.html#Filesystem" accesskey="n" rel="next">Filesystem</a>, Up: <a href="Host-Config.html#Host-Config" accesskey="u" rel="up">Host Config</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
